package Creational.Builder.example;

import javafx.scene.image.Image;

//具体产品
//对象的组成部分
public class Text {

    private String chars;

    private String font;

    private String img;

    public void setChars(String chars) {
        this.chars = chars;
    }

    public void setFont(String font) {
        this.font = font;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public void show(){
        System.out.println(this.toString());
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Text text = (Text) o;

        if (chars != null ? !chars.equals(text.chars) : text.chars != null) return false;
        if (font != null ? !font.equals(text.font) : text.font != null) return false;
        return img != null ? img.equals(text.img) : text.img == null;
    }

    @Override
    public int hashCode() {
        int result = chars != null ? chars.hashCode() : 0;
        result = 31 * result + (font != null ? font.hashCode() : 0);
        result = 31 * result + (img != null ? img.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Text{" +
                "chars='" + chars + '\'' +
                ", font='" + font + '\'' +
                ", img=" + img +
                '}';
    }
}
